Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

npm-packlist

Package Overview
Dependencies
Maintainers
5
Versions
64
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

npm-packlist

Get a list of the files to add from a folder into an npm package

  • 8.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
9.1M
decreased by-3.87%
Maintainers
5
Weekly downloads
 
Created

What is npm-packlist?

The npm-packlist package is used to generate a list of files that would be included in an npm package publish. This includes filtering out files that are not meant to be published, such as those specified in `.npmignore` or the `.gitignore` files, and including those specified in the `files` array in `package.json`. It's useful for package authors to understand and control what gets included in their published npm package.

What are npm-packlist's main functionalities?

Generate packlist

This feature allows you to generate a list of files that would be included if you were to publish the current package. The code sample demonstrates how to use npm-packlist to get an array of file paths that are included in the package's publish list.

const packlist = require('npm-packlist');
packlist().then(files => {
  console.log(files)
});

Customize packlist with package.json

While not a direct feature of npm-packlist, the package respects the `files` field in `package.json`. This allows users to explicitly specify which files or directories should be included in the publish. The code sample shows how to specify a list of files and directories in `package.json` that should be included in the npm package.

{
  "files": [
    "lib/**/*",
    "bin/*",
    "README.md"
  ]
}

Other packages similar to npm-packlist

FAQs

Package last updated on 08 Jan 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc